<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:t="http://www.pagac.cz/jsf">
 <h:head></h:head>
 <h:body>
    <ui:composition template="/WEB-INF/templates/template-insystem.xhtml">
        <ui:define name="toolbar-place">
            <t:toolbar>
                <t:icon iconName="home" action="goHome" sideLabel="false" label="#{msgs['app.goToHomePage']}" />
                <t:icon iconName="print" action="printPage" />
            </t:toolbar>
        </ui:define>

       <ui:define name="content-title">
           <h1>#{msgs["user.main.page-title"]}</h1>
       </ui:define>
        
        <ui:define name="content">
            <h:outputStylesheet library="css" name="userBigMenu.css" />
            <ul class="bigMenu">
                <li>
                    <a href="#{request.contextPath}/user/project/create.jsf">
                        <div>
                            <h3>#{msgs["user.main.create-project"]}</h3>
                            #{msgs["user.main.create-project-note"]}
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#{request.contextPath}/user/customer/create.jsf">
                        <div>
                                <h3>#{msgs["user.main.create-customer"]}</h3>
                                #{msgs["user.main.create-customer-note"]}
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#{request.contextPath}/user/invoice/create.jsf">
                    <div>
                        <h3>#{msgs["user.main.create-invoice"]}</h3>
                        #{msgs["user.main.create-invoice-note"]}
                    </div>
                    </a>
                </li>
                <li>
                    <div>
                        <h3>#{msgs["user.main.modify-settings"]}</h3>
                        #{msgs["user.main.modify-settings-note"]}
                    </div>
                </li>
            </ul>

            <hr class="cleaner" />
            <h2>#{msgs['app.project.recent-title']}</h2>

             <!-- Project Listing -->
                <h:outputStylesheet name="cssRecentTable.css" library="css" />
                <h:outputText styleClass="warning-messages-noitems" value="#{msgs['app.listing.no-records']}"
                        rendered="#{projectManager.dataModelRecordsCount == 0}" />

                <h:dataTable id="projectTable"
                             value="#{projectManager.listRecent}"
                             var="project"
                             styleClass="listing"
                             rendered="#{projectManager.dataModelRecordsCount != '0'}"
                             columnClasses="name, other, actions">
                    <t:columnNH  entity="${project}" fieldName="name"
                                 backingBean="#{projectManager}" label="#{msgs['user.project.list.name']}">
                        <h:commandLink action="#{projectManager.detail}">
                            #{project.name}
                        </h:commandLink>

                        <f:verbatim rendered="#{project.isActive == 'n'}">
                            <span style="font-size: 0.8em; color:red;">(#{msgs['user.project.list.activeFalse']})</span>
                        </f:verbatim>
                    </t:columnNH>
                    <t:columnNH entity="${project}"
                               fieldName="other" backingBean="#{projectManager}"
                               label="#{msgs['user.project.list.forCustomer']}">
                            (
                        <h:commandLink action="#{projectManager.customerDetail}">
                                #{projectManager.rowCustomerName}
                           </h:commandLink>
                           &nbsp; | &nbsp;
                           #{project.create}
                           &nbsp; | &nbsp;
                           #{project.note}
                           )
                    </t:columnNH>
                   <t:columnCommandNH label="#{msgs['user.project.list.actions']}">
                        <h:commandLink value="#{msgs['user.project.list.actions.edit']}" action="#{projectManager.edit}" /> |
                        <h:commandLink value="#{msgs['user.project.list.actions.newtask']}" action="#{projectManager.newTask}" /> |
                        <h:commandLink value="#{msgs['user.project.list.actions.detail']}" action="#{projectManager.detail}" />
                   </t:columnCommandNH>
                </h:dataTable>

       </ui:define>
    </ui:composition>

</h:body>
</html>
